import App from './App'

import Vue from 'vue'
import _ from 'lodash'

import * as util from './common/util'

_.merge(_, _.omit(util, _.keys(_)))
Vue.prototype._ = _
global._ = _ // 打包后无效

import dayjs from 'dayjs'

global.dayjs = dayjs // 打包后无效

Vue.prototype.util = util

import store from './store'
import { modelGet, modelAssign, modelSet, modelSetWithServer } from './store/modelOpt.js'

Vue.prototype.modelSet = modelSet
Vue.prototype.modelAssign = modelAssign
Vue.prototype.modelGet = modelGet
Vue.prototype.modelSetWithServer = modelSetWithServer

import { router, RouterMount } from './router'

Vue.use(router)

import './components/index'

Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
  store,
  ...App,
})

// v1.3.5起 H5端 你应该去除原有的app.$mount();使用路由自带的渲染方式
// #ifdef H5
RouterMount(app, router, '#app')
// #endif

// #ifndef H5
app.$mount() //为了兼容小程序及app端必须这样写才有效果
// #endif
